<extend name="Base/common"/>
<block name="style">
<style type="text/css">
	.head{
		width:100%;
		height:100%;
		padding-top: 13px;
	}
	.formtijiao{
		width:93%;
		height:auto;
		margin:auto; 
        font-size: 14px;

	}
    .tips{
        position:fixed;
        /*top:-10px;*/
        background: rgba(41,81,196,0.5);
        width:100%;
        color:#fff;
        font-size:16px;
        text-align: left;
        text-indent: 2em;
        line-height:30px;
        z-index: 99;
        display: none;
    }

</style>
</block>
<block name="body">
	<p class="tips"></p>


    <div class="content">
        <!-- <div class="login-logo"><img src="__IMG__/lianfu.jpg" /></div> -->
        <form class="formtijiao" action="" method="post">
            <div class="login-register mg-t-8 clearfix">
                
                    <ul class="register-kk">
                        <li><em>账号</em>
                            <input type="text" name="account"   class="register-sh mobile" style="width:145px;" />
                        </li>
                        <li><em>新密码</em>
                            <input type="password" name="npassword"  class="register-sh account" style="width:145px;" />
                        </li>
                        <li><em>验证码</em><input type="text"  placeholder="请输入验证码"  name="code" class="register-sh captcha" style="width:40%"/>
                                <input type="button" class="get_code" style="width:25%;height:30px;float:right;font-size:12px;margin-top:9px;" value="获取验证码">
                        </li>
                    </ul>
                   
                    <input type="button"  value="重置密码" class="login-btn" style="height:35px;"/>  
                
         </form>
    </div>
</block>



<block name="script">
<script type="text/javascript">

    
        $('.get_code').click(function(){
                var mobile = $('.mobile').val();//手机号码
                $.ajax({
                    type:'post',
                    url:"{:U('Koubei/get_code')}",
                    data:{'mobile':mobile,'type':2},
                    success:function(m){
                        if(m==11){
                            $('.tips').html('验证码已发送，请注意查收')
                            $('.tips').show()
                            setTimeout(function(){
                                $('.tips').hide()
                                
                            },3000)

                        }else{
                            $('.tips').html(m)
                            $('.tips').show()
                            setTimeout(function(){
                                $('.tips').hide()
                                
                            },3000)
                        }
                    }
                });

        });

        $('.login-btn').click(function(){
                var data=$('form').serializeArray();
                $.ajax({
                    type:'post',
                    url:"",
                    data:data,
                    success:function(m){
                        if(m>0){
                            $('.tips').html('修改成功')
                            $('.tips').show()
                            setTimeout(function(){
                                $('.tips').hide()
                                
                            },3000)

                        }else if(m==0){
                            $('.tips').html('修改失败')
                            $('.tips').show()
                            setTimeout(function(){
                                $('.tips').hide()
                                
                            },3000)
                        }else{
                            $('.tips').html(m)
                            $('.tips').show()
                            setTimeout(function(){
                                $('.tips').hide()
                                
                            },3000)
                        }
                    }
                });

        });
    </script>

</block>